﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ContaEmail.aspx.cs" Inherits="PortalCurriculo.WebUI.CentralEmail.ContaEmail" %>

<%@ Register Assembly="PortalCurriculo.Util.CustomControls" Namespace="PortalCurriculo.Util.CustomControls"
    TagPrefix="portal" %>
<%@ Register TagPrefix="Portal" Src="~/UserControls/Email.ascx" TagName="Email" %>
<%@ Register TagPrefix="Portal" Src="~/UserControls/Senha.ascx" TagName="Senha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePage" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageTitle" runat="server">
    <asp:Label ID="lblTitulo" runat="server" Text="Cadastro de contas de email" CssClass="pageTitle" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="uppContaEmail" runat="server">
        <ContentTemplate>
            <asp:Panel runat="server" ID="pnlCampos" Visible="false">
                <table cellspacing="10px">
                    <tr>
                        <td>
                            <asp:Label ID="lblDisplayName" runat="server" Text="Display Name" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDisplayName" runat="server" MaxLength="255" />
                            <asp:RequiredFieldValidator ID="RequiredValidatorDisplayName" runat="server" ControlToValidate="txtDisplayName"
                                CssClass="failureNotification" ErrorMessage="Preencha o campo email" ToolTip="Campo obrigatório"
                                Text="*" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblEmail" runat="server" Text="Email" />
                        </td>
                        <td style="margin-left: 40px">
                            <portal:Email ID="Email" runat="server" />
                        </td>
                    </tr>
                    <portal:Senha ID="Senha" runat="server" MostrarConfirmarSenha="true" />
                    <tr>
                        <td>
                            <asp:Label ID="lblSmtpHost" runat="server" Text="Host SMTP" />
                        </td>
                        <td style="margin-left: 40px">
                            <asp:TextBox ID="txtSmtpHost" runat="server" MaxLength="255" />
                            <asp:RequiredFieldValidator ID="rfvSmtpHost" runat="server" ControlToValidate="txtSmtpHost"
                                CssClass="failureNotification" ErrorMessage="Preencha o campo SMTP Host" ToolTip="Campo obrigatório"
                                Text="*" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblSmtpPort" runat="server" Text="Porta SMTP" />
                        </td>
                        <td style="margin-left: 40px">
                            <asp:TextBox ID="txtSmtpPort" runat="server" MaxLength="4" />
                            <asp:RequiredFieldValidator ID="rfvSmtpPort" runat="server" ControlToValidate="txtSmtpPort"
                                CssClass="failureNotification" ErrorMessage="Preencha o campo Porta SMTP" ToolTip="Campo obrigatório"
                                Text="*" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:LinkButton runat="server" ID="lnkSalvar" Text="Adicionar" OnClick="lnkSalvar_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:LinkButton ID="lnkAdicionar" runat="server" Text="Adicionar conta de email"
                OnClick="lnkAdicionar_Click" />
            <br />
            <br />
            <portal:ListView ID="lsvContaEmail" runat="server" ItemPlaceholderID="phItens" onitemdatabound="lsvContaEmail_ItemDataBound">
                <layouttemplate>
                    <table width="100%">
                        <tr>    
                            <td style="width:30%;text-align:center;"><asp:Label runat="server" ID="lblDisplayName" Text="Display Name" /></td>
                            <td style="width:30%;text-align:center;"><asp:Label runat="server" ID="lblEmail" Text="Email" /></td>
                            <td style="width:20%;text-align:center;"><asp:Label runat="server" ID="lblSmtpHost" Text="Host SMTP" /></td>
                            <td style="width:30px;text-align:center;"><asp:Label runat="server" ID="lblSmtpPort" Text="Porta SMTP" /></td>
                            <td style="width:15px;"></td>
                        </tr>
                        <asp:PlaceHolder ID="phItens" runat="server" />
                    </table>
                </layouttemplate>
                <itemtemplate>
                    <tr>
                        <td><asp:Label runat="server" ID="lblDisplayName" Text="Display name" /></td>
                        <td><asp:Label runat="server" ID="lblEmail" Text="Email" /></td>
                        <td><asp:Label runat="server" ID="lblSmtpHost" Text="Host SMTP" /></td>
                        <td><asp:Label runat="server" ID="lblSmtpPort" Text="Porta SMTP" /></td>
                        <td><asp:ImageButton runat="server" ID="imbEditar" ImageUrl="~/Files/Layout/Buttons/Edit.png" /> 
                        <asp:ImageButton runat="server" ID="imbExcluir" ImageUrl="~/Files/Layout/Excluir.gif" 
                            OnClick="imbExcluir_Click" OnClientClick="javascript:return confirm('Tem certeza que deseja excluir essa conta de email?');" /> </td>
                    </tr>
                </itemtemplate>
                <emptydatatemplate>
                    <asp:Label runat="server" ID="lblVazio" Text="Não há contas de email cadastradas." CssClass="failureNotification" />
                </emptydatatemplate>
            </portal:ListView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
